define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'jizhan.store_order_sum/index',
        add_url: 'jizhan.store_order_sum/add',
        edit_url: 'jizhan.store_order_sum/edit',
        delete_url: 'jizhan.store_order_sum/delete',
        export_url: 'jizhan.store_order_sum/export',
        modify_url: 'jizhan.store_order_sum/modify',
        activity_product_url: 'jizhan.activity_product/index',
    };
    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: "checkbox"},
                    {field: 'payPriceSum', title: '订单金额总数', search: 'no'},
                    {field: 'orderNum', title: '订单总数量', search: 'no'},
                    {field: 'offlinePayPrice', title: '线下订单总销售额', search: 'no'},
                    {field: 'onlinePayPrice', title: '线上订单总销售额', search: 'no'},
                    {field: 'orderRate', title: '线下订单与线上订单占比', search: 'no'},
                    {field: 'payTime', title: '订单支付时间', hide: true ,search: 'range'},
                    {field: 'store_id', title: '门店id', hide: true ,selectList: storeList},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});